import pymysql

# Open database connection
db = pymysql.connect(host='localhost', user="root", password="123456", database="cangku",autocommit=True)

# prepare a cursor object using cursor() method
cursor = db.cursor()

# sql_02 = "select * from products where number = '1'"
# sql_03 = "select * from products where type = '滑轮'"
# sql_01 = "delete from products where number = '1'"
# cursor.execute(sql_03)
# result = cursor.fetchall()
# print(result)
# # 查看更新后的结果

sql = "SELECT* FROM products"

def storage():
    cursor.execute(sql)
    data = cursor.fetchall()
    return data




